package com.exercise.beginner

import android.content.Intent
import android.os.Bundle
import android.widget.TextView
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.exercise.beginner.adapterview.AdapterViewActivity
import com.exercise.beginner.constraint.ConstraintActivity
import com.exercise.beginner.slidingpanellayout.SlidingPanelLayoutActivity

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_main)
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
            val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
            insets
        }

        findViewById<TextView>(R.id.adapterViewBtn).setOnClickListener {
            startActivity(Intent(this, AdapterViewActivity::class.java))
        }
        findViewById<TextView>(R.id.slidingPanelLayout).setOnClickListener {
            startActivity(Intent(this, SlidingPanelLayoutActivity::class.java))
        }
        findViewById<TextView>(R.id.constraintLayout).setOnClickListener {
            startActivity(Intent(this, ConstraintActivity::class.java))
        }

    }
}